
@echo off

if     "%1" == "clean" goto clean
if     "%1" == "slk" goto slk 
if     "%1" == "lr" goto lr
if     "%1" == "comp" goto comp
if     "%1" == "help" goto usage
if     "%1" == "" goto usage

:slk
%SLK%slk %2 %3 %4 %5 calc.ll > slk.out
goto comp

:lr
%SLK%slk %2 %3 %4 %5 -LR calc.lr > slk.out

:comp
icc calc.c action.c tree.c SlkParse.c SlkString.c
goto exit

:clean
	@rm -f *.obj
	@rm -f *.out
	@rm -f *.lst
	@rm -f *.err
	@rm -f *.map
        @rm -f *.def
        @rm -f *.exe
        @rm -f SlkString.*
        @rm -f SlkTable.*
        @rm -f SlkParse.*
        @rm -f SlkKeywords.*
        @rm -f SlkTerminals.h
        @rm -f SlkConstants.h
        @rm -f SlkExecute.txt
        @rm -f SlkState.*        
        @rm -f xxx*

goto exit

:usage
echo Usage:  mak [clean] [help] [comp] [slk] [lr] [flags]
echo             can set SLK=\slk\ to get it from \slk

:exit
